﻿using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Data;
using System.Text;

namespace RayD.Core
{

    public static partial class Extention
    {
        /// <summary>
        /// 获取List长度(Null值返回 0)
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="list"></param>
        /// <returns></returns>
        public static int Length<T>(this List<T> list)
        {
            if (!list.IsEmpty())
            {
                return list.Count;
            }
            else
            {
                return 0;
            }
        }
    }
}
